<template>
  <div class="mnt-dialog form-container">
    <el-form ref="form" :model="formModel" label-width="160px" :rules="rules">
      <el-row style="text-align: center">
        <el-col :span="12">
          <el-form-item label="车辆一致性证书编号:" label-width="300px" prop="consistencyCertificateNo">
            <el-input v-model="formModel.consistencyCertificateNo" :readonly="readonly" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="证书类型:" label-width="300px" prop="type">
            <el-input v-model="formModel.type" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆制造国:" label-width="300px" prop="clzzgs">
            <el-input v-model="formModel.clzzgs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆生产企业名称:" label-width="300px" prop="jbzzsmc">
            <el-input v-model="formModel.jbzzsmc" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆生产企业地址:" label-width="300px" prop="jbzzsdz">
            <el-input v-model="formModel.jbzzsdz" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="生产者(制造商)名称:" label-width="300px" prop="clzzqymc">
            <el-input v-model="formModel.clzzqymc" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆识别代号打刻位置:" label-width="300px" prop="clsbhwz">
            <el-input v-model="formModel.clsbhwz" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆识别代号是否使用车型年份:" label-width="300px" prop="clsbhsfsycxnf">
            <hey-select v-model="formModel.clsbhsfsycxnf" :clearable="false" clcd="ind_cd" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="新能源车:" label-width="300px" prop="xnyc">
            <el-input v-model="formModel.xnyc" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="法定铭牌的位置:" label-width="300px" prop="fdmpwz">
            <el-input v-model="formModel.fdmpwz" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车型名称:" label-width="300px" prop="cxmc">
            <el-input v-model="formModel.cxmc" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆型号:" label-width="300px" prop="clxh">
            <el-input v-model="formModel.clxh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆注册类型:" label-width="300px" prop="cxxldh">
            <el-input v-model="formModel.cxxldh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆型式:" label-width="300px" prop="clxs">
            <el-input v-model="formModel.clxs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆类别:" label-width="300px" prop="cllb">
            <el-input v-model="formModel.cllb" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="中文品牌:" label-width="300px" prop="clzwpp">
            <el-input v-model="formModel.clzwpp" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="英文品牌:" label-width="300px" prop="clywpp">
            <el-input v-model="formModel.clywpp" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="标牌位置:" label-width="300px" prop="bpwz">
            <el-input v-model="formModel.bpwz" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="基本车辆一致性证书编号:" label-width="300px" prop="jbclyzxzsbh">
            <el-input v-model="formModel.jbclyzxzsbh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆形式:" label-width="300px" prop="clxs">
            <el-input v-model="formModel.cxdh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="基本车辆类别:" label-width="300px" prop="jbcllx">
            <el-input v-model="formModel.jbcllx" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最终阶段车辆CCC证书编号(版本号):" label-width="300px" prop="ccczsh">
            <el-input v-model="formModel.ccczsh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="CCC证书签发日期:" label-width="300px" prop="qfrq">
            <el-date-picker
              v-model="formModel.qfrq"
              align="right"
              type="date"
              placeholder="选择日期"
              :picker-options="pickerOptions"
              value-format="yyyy-MM-dd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="货厢内部尺寸-长度（mm）:" label-width="300px" prop="hxnbccc">
            <el-input v-model="formModel.hxnbccc" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="货厢内部尺寸-宽度（mm）:" label-width="300px" prop="hxnbcck">
            <el-input v-model="formModel.hxnbcck" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="货厢内部尺寸-高度（mm）:" label-width="300px" prop="hxnbccg">
            <el-input v-model="formModel.hxnbccg" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="牵引装置中心与车辆最后端之间的距离(mm):" label-width="300px" prop="clqdyqyzzjl">
            <el-input v-model="formModel.clqdyqyzzjl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="整备质量（kg）:" label-width="300px" prop="zdzhzl">
            <el-input v-model="formModel.zdzhzl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="额定载质量（kg）:" label-width="300px" prop="edzzl">
            <el-input v-model="formModel.edzzl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="载质量利用系数（kg）:" label-width="300px" prop="zzllyxs">
            <el-input v-model="formModel.zzllyxs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车门数量和结构:" label-width="300px" prop="cmsljg">
            <el-input v-model="formModel.cmsljg" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最大允许总质量（kg）:" label-width="300px" prop="jszdzzzl">
            <el-input v-model="formModel.jszdzzzl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最大允许总质量对应的轴荷分配（kg）:" label-width="300px" prop="gcljdzdczfh">
            <el-input v-model="formModel.gcljdzdczfh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="是否拖挂:" label-width="300px" prop="sfyxtg">
            <hey-select v-model="formModel.sfyxtg" :clearable="false" clcd="ind_cd" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最大允许牵引质量:" label-width="300px" prop="zdyxqyzl">
            <el-input v-model="formModel.zdyxqyzl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="燃料种类:" label-width="300px" prop="rlzl">
            <el-input v-model="formModel.rlzl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="直接喷射:" label-width="300px" prop="zjps">
            <el-input v-model="formModel.zjps" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="气缸数量:" label-width="300px" prop="qgsl">
            <el-input v-model="formModel.qgsl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="气缸排列形式:" label-width="300px" prop="qgplxs">
            <el-input v-model="formModel.qgplxs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="排量（L）:" label-width="300px" prop="pl">
            <el-input v-model="formModel.pl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="电动机生产厂名称:" label-width="300px" prop="ddjsccmc">
            <el-input v-model="formModel.ddjsccmc" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车电动机型号:" label-width="300px" prop="cddjxh">
            <el-input v-model="formModel.cddjxh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="电动机工作电压（V）:" label-width="300px" prop="ddjgzdy">
            <el-input v-model="formModel.ddjgzdy" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最大输出功率（kW）:" label-width="300px" prop="zdjgl">
            <el-input v-model="formModel.zdjgl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="动力电池型号:" label-width="300px" prop="dldcxh">
            <el-input v-model="formModel.dldcxh" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="动力电池额定电压（V）:" label-width="300px" prop="dldceddy">
            <el-input v-model="formModel.dldceddy" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="动力电池生产厂名称（单体）:" label-width="300px" prop="dldcsccmcDt">
            <el-input v-model="formModel.dldcsccmcDt" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="动力电池生产厂名称（模块）:" label-width="300px" prop="dldcsccmcMk">
            <el-input v-model="formModel.dldcsccmcMk" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="动力电池额定容量（Ah）:" label-width="300px" prop="dldcedrl">
            <el-input v-model="formModel.dldcedrl" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="离合器形式:" label-width="300px" prop="lhqxs">
            <el-input v-model="formModel.lhqxs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="变速器型式:" label-width="300px" prop="bsqxs">
            <el-input v-model="formModel.bsqxs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="速比:" label-width="300px" prop="sb">
            <el-input v-model="formModel.sb" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="主传动比:" label-width="300px" prop="zcdb">
            <el-input v-model="formModel.zcdb" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="基本车辆制造国:" label-width="300px" prop="jbclzzg">
            <el-input v-model="formModel.jbclzzg" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="转向型式:" label-width="300px" prop="fzzxfs">
            <el-input v-model="formModel.fzzxfs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="最该设计车速:" label-width="300px" prop="zgcs">
            <el-input v-model="formModel.zgcs" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="轮胎规格:" label-width="300px" prop="ltgg">
            <el-input v-model="formModel.ltgg" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="制动装置简要说明:" label-width="300px" prop="zdzzjysm">
            <el-input v-model="formModel.zdzzjysm" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="是否带防抱死系统:" label-width="300px" prop="sfdbsxt">
            <hey-select v-model="formModel.sfdbsxt" :clearable="false" clcd="ind_cd" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="额定载客人数:" label-width="300px" prop="edzkrs">
            <el-input v-model="formModel.edzkrs" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="钢板弹簧片数（片）:" label-width="300px" prop="gbthps">
            <el-input v-model="formModel.gbthps" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="车轴数量:" prop="czs">
            <el-input v-model="formModel.czs" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="车轮数量:" prop="cls">
            <el-input v-model="formModel.cls" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="轮距（mm）:" prop="lj">
            <el-input v-model="formModel.lj" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="驱动轴位置:" prop="qdz">
            <el-input v-model="formModel.qdz" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="轴距（mm）:" prop="zj">
            <el-input v-model="formModel.zj" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="外廓尺寸-长（mm）:" prop="cd">
            <el-input v-model="formModel.cd" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="外廓尺寸-宽（mm）:" prop="kd">
            <el-input v-model="formModel.kd" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="外廓尺寸-高（mm）:" prop="gd">
            <el-input v-model="formModel.gd" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="前悬（mm）:" prop="qx">
            <el-input v-model="formModel.qx" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="后悬（mm）:" prop="hx">
            <el-input v-model="formModel.hx" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="接近角（°）:" prop="jjj">
            <el-input v-model="formModel.jjj" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="离去角（°）:" prop="lqj">
            <el-input v-model="formModel.lqj" />
          </el-form-item>
        </el-col>
        <fieldset>
          <legend>声级</legend>
          <div>
            <br>
            <el-col :span="24">
              <el-form-item label="定置噪声/加速行驶车外噪声国家标准及对应的实施阶段:" label-width="380px" prop="sj3cbzh">
                <el-input v-model="formModel.sj3cbzh" />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="定置噪声[dB（A）]/发动机转速（min-1）:" label-width="380px" prop="dzzs">
                <el-input v-model="formModel.dzzs" />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="加速行驶车外噪声[dB（A）]:" label-width="380px" prop="jsxscwzs">
                <el-input v-model="formModel.jsxscwzs" />
              </el-form-item>
            </el-col>
          </div>
        </fieldset>
        <br>
        <fieldset>
          <legend>排气排放物</legend>
          <div>
            <br>
            <el-col :span="24">
              <el-form-item label="CCC认证引用的标准号及对应的实施阶段:" label-width="300px" prop="pq3cbzh">
                <el-input v-model="formModel.pq3cbzh" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_CO:" label-width="300px" prop="syyt">
                <el-input v-model="formModel.syyt" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_Nox:" label-width="300px" prop="ytcf">
                <el-input v-model="formModel.ytcf" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_烟度(m-1):" label-width="300px" prop="ytyd">
                <el-input v-model="formModel.ytyd" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_HC:" label-width="300px" prop="qtcf">
                <el-input v-model="formModel.qtcf" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_THC:" label-width="300px" prop="ytrlThc">
                <el-input v-model="formModel.ytrlThc" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_NMHC:" label-width="300px" prop="ytrlNmhc">
                <el-input v-model="formModel.ytrlNmhc" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_HC+Nox:" label-width="300px" prop="ytwlw">
                <el-input v-model="formModel.ytwlw" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_粒子数量(PN):" label-width="300px" prop="ytrlLzsl">
                <el-input v-model="formModel.ytrlLzsl" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="污染物排放实施阶段:" label-width="300px" prop="wrwpfssjd">
                <el-input v-model="formModel.wrwpfssjd" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_N2O:" label-width="300px" prop="syqt">
                <el-input v-model="formModel.syqt" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="液体燃料_颗粒物(PM):" label-width="300px" prop="ytrlklw">
                <el-input v-model="formModel.ytrlklw" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_CO:" label-width="300px" prop="qtrlCo">
                <el-input v-model="formModel.qtrlCo" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_NMHC:" label-width="300px" prop="qtrlNmhc">
                <el-input v-model="formModel.qtrlNmhc" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_CH4:" label-width="300px" prop="qtrlCh4">
                <el-input v-model="formModel.qtrlCh4" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="试验用气体燃料_NH3:" label-width="300px" prop="qtrlNh3">
                <el-input v-model="formModel.qtrlNh3" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_Nox:" label-width="300px" prop="qtrlNox">
                <el-input v-model="formModel.qtrlNox" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_THC:" label-width="300px" prop="qtrlThc">
                <el-input v-model="formModel.qtrlThc" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_微粒物:" label-width="300px" prop="qtwlw">
                <el-input v-model="formModel.qtwlw" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="气体燃料_N2O:" label-width="300px" prop="qtrlN2o">
                <el-input v-model="formModel.qtrlN2o" />
              </el-form-item>
            </el-col>
          </div>
        </fieldset>
        <br>
        <fieldset>
          <legend>CO2排放量/燃料消耗量</legend>
          <div>
            <br>
            <el-col :span="24">
              <el-form-item label="CO2排放量标准/燃料消耗量标准:" label-width="250px" prop="co23cbzh">
                <el-input v-model="formModel.co23cbzh" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="市区 CO2排放量:" label-width="250px" prop="sqpfl">
                <el-input v-model="formModel.sqpfl" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="市区 燃料消耗量:" label-width="250px" prop="sqrlxhl">
                <el-input v-model="formModel.sqrlxhl" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="郊区 CO2排放量:" label-width="250px" prop="jqpfl">
                <el-input v-model="formModel.jqpfl" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="郊区 燃料消耗量:" label-width="250px" prop="jqrlxhl">
                <el-input v-model="formModel.jqrlxhl" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="综合 CO2排放量:" label-width="250px" prop="zhpfl">
                <el-input v-model="formModel.zhpfl" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="综合 燃料消耗量:" label-width="250px" prop="zhrlxhl">
                <el-input v-model="formModel.zhrlxhl" />
              </el-form-item>
            </el-col>
          </div>
        </fieldset>
        <br>
        <fieldset>
          <legend>发动机及车辆信息</legend>
          <div>
            <br>
            <el-col :span="12">
              <el-form-item label="发动机制造商:" prop="fdjzzs">
                <el-input v-model="formModel.fdjzzs" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发动机型号:" prop="fdjxh">
                <el-input v-model="formModel.fdjxh" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="发动机编号位置:" prop="fdjbhwz">
                <el-input v-model="formModel.fdjbhwz" />
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="车辆种类:" prop="cxzl">
                <el-input v-model="formModel.cxzl" />
              </el-form-item>
            </el-col>
          </div>
        </fieldset>
        <br>
        <el-col :span="24">
          <el-form-item label="认证委托人名称:" prop="rzwtrmc">
            <el-input v-model="formModel.rzwtrmc" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="委托人名称:" prop="wtrmc">
            <el-input v-model="formModel.wtrmc" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="委托人:" prop="wtr">
            <el-input v-model="formModel.wtr" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="联系电话:" prop="wtrlxdh">
            <el-input v-model="formModel.wtrlxdh" />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="备注:" prop="remarks">
            <el-input v-model="formModel.remarks" type="textarea" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="状态:" prop="status">
            <hey-select v-model="formModel.status" clcd="is_effective_cd" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <el-row class="submit-area">
      <el-col :span="24">
        <el-button @click="closeDialog">取消</el-button>
        <el-button type="primary" @click="handleSubmit()">确定</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>

export default {
  name: 'ConsistencyCertificateMnt',
  props: ['pageType', 'editData'],
  data() {
    return {
      // 日期组件
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now()
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            picker.$emit('pick', new Date())
          }
        }, {
          text: '昨天',
          onClick(picker) {
            const date = new Date()
            date.setTime(date.getTime() - 3600 * 1000 * 24)
            picker.$emit('pick', date)
          }
        }, {
          text: '一周前',
          onClick(picker) {
            const date = new Date()
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', date)
          }
        }]
      },
      readonly: false,
      formModel: {
        consistencyCertificateId: '',
        consistencyCertificateNo: '',
        clzzqymc: '',
        clzzgs: '',
        cxxldh: '',
        clxs: '',
        cxdh: '',
        cxmc: '',
        cllb: '',
        clzwpp: '',
        clywpp: '',
        bpwz: '',
        jbzzsmc: '',
        jbzzsdz: '',
        zzzzsmc: '',
        zzzzsdz: '',
        fdmpwz: '',
        clsbh: '',
        clsbhwz: '',
        clsbhsfsycxnf: '',
        fdjbh: '',
        fdjbhwz: '',
        ccczsh: '',
        qfrq: '',
        type: '',
        model: '',
        czs: '',
        cls: '',
        lj: '',
        qdz: '',
        zj: '',
        cd: '',
        kd: '',
        gd: '',
        qx: '',
        hx: '',
        jjj: '',
        lqj: '',
        yxztclzl: '',
        jszdzzzl: '',
        czjzlfp: '',
        gczjszdzl: '',
        cdzdzh: '',
        gczdzl: '',
        zdzhzl: '',
        gcljdzdczfh: '',
        sfyxtg: '',
        zdyxqyzl: '',
        fdjzzs: '',
        fdjxh: '',
        fdjgzyl: '',
        zjps: '',
        qgsl: '',
        qgplxs: '',
        pl: '',
        rlzl: '',
        zdjgl: '',
        lhqxs: '',
        bsqxs: '',
        sb: '',
        zcdb: '',
        jbclzzg: '',
        ltgg: '',
        fzzxfs: '',
        zdzzjysm: '',
        csxs: '',
        csys: '',
        cmsljg: '',
        zyslwz: '',
        qyzzbz: '',
        zgcs: '',
        sj3cbzh: '',
        dzzs: '',
        fdjzs: '',
        jsxscwzs: '',
        pq3cbzh: '',
        syyt: '',
        ytcf: '',
        ytyd: '',
        ytwlw: '',
        syqt: '',
        qtcf: '',
        qtwlw: '',
        co23cbzh: '',
        sqpfl: '',
        jqpfl: '',
        zhpfl: '',
        sqrlxhl: '',
        jqrlxhl: '',
        zhrlxhl: '',
        clqdyqyzzjl: '',
        cltymj: '',
        jdcljdjszdzl: '',
        qdzsfzkqxg: '',
        gczdxtgqgnyl: '',
        zws: '',
        zzqycd: '',
        zzllyxs: '',
        gbthps: '',
        hxnbccc: '',
        hxnbcck: '',
        hxnbccg: '',
        ytrlLzsl: '',
        wrwpfssjd: '',
        qtrlCo: '',
        qtrlCh4: '',
        qtrlNh3: '',
        qtrlThc: '',
        qtrlN2o: '',
        qtrlNmhc: '',
        qtrlNox: '',
        ytrlklw: '',
        xnyc: '',
        jbcllx: '',
        ddjsccmc: '',
        ddjgzdy: '',
        dldcxh: '',
        dldcsccmcDt: '',
        dldcsccmcMk: '',
        sfdbsxt: '',
        edzzl: '',
        cddjxh: '',
        dldceddy: '',
        dldcedrl: '',
        edzkrs: '',
        cxzl: '',
        clxh: '',
        jbcllb: '',
        jbclyzxzsbh: '',
        ytrlThc: '',
        ytrlNmhc: '',
        rzwtrmc: '',
        wtrmc: '',
        wtr: '',
        wtrlxdh: '',
        remarks: '',
        status: '1'
      },
      // 老数据
      oldFormModel: {
      },
      rules: {}
    }
  },
  computed: {},
  mounted() {
    this.init()
  },
  methods: {
    init() {
      this.$form = this.$refs.form
      const { pageType, editData, formModel } = this
      if (pageType !== 'add') {
        this.assignData(editData, formModel)
        this.oldFormModel = JSON.parse(JSON.stringify(this.formModel))
        this.readonly = true
      }
      this.initRules()
    },
    initRules() {
      const REQUIRED_MSG = this.CONST.REQUIRED_MSG
      this.rules = {
        consistencyCertificateNo: [{ required: true, message: REQUIRED_MSG, trigger: ['change', 'blur'] }],
        type: [{ required: true, message: REQUIRED_MSG, trigger: ['change', 'blur'] }]
      }
      this.$nextTick(_ => {
        this.$form.clearValidate()
      })
    },
    handleSubmit() {
      this.$refs.form.validate(valid => {
        if (valid) {
          if (this.formModel.consistencyCertificateId !== '') {
            // 判断是否修改
            if (JSON.stringify(this.formModel) !== JSON.stringify(this.oldFormModel)) {
              const tip = '修改成功！'
              const url = '/consistencyCertificate/update'
              this.post(url, this.formModel).then(res => {
                this.$info(tip, () => {
                  this.$emit('mntSuc', res)
                  this.closeDialog()
                })
              })
            } else {
              this.$emit('mntSuc')
              this.closeDialog()
            }
          } else {
            const url = '/consistencyCertificate/save'
            this.post(url, this.formModel).then(res => {
              const tip = '新增成功！'
              this.$info(tip, () => {
                this.$emit('mntSuc', res)
                this.closeDialog()
              })
            })
          }
        }
      })
    },
    closeDialog() {
      this.$parent.$emit('update:visible', false)
    }
  }
}

</script>

<style lang="scss" scoped>

</style>
